﻿<div class="wrapper-md" ng-controller="ListController">
  <div class="panel panel-default">
    
    <div class="panel-header flex space-between aic">
      <div class="">新闻列表</div>
      <div><button class="btn  btn-sm btn-primary btn-addon" ui-sref="app.news.create()"><i class="fa fa-plus"></i>新增</button></div>
    </div>

    <div class="wrapper flex space-between  aic">
      <div class="">
        <select class="input-sm form-control w-sm inline v-middle" ng-model="operate" ng-init="operate=0">
          <option value="0">---</option>
          <option value="1">删除所选记录</option>
          <option value="2">下架所选项目</option>
        </select>
        <button class="btn btn-sm btn-default" ng-click="exec()">执行</button>                
      </div>
      
      <div class="flex-1">
        <div class="flex aic flex-right">
            <div class=" mr-5">
              <span>开始时间:</span>
              <input type="text" laydate='{"format":"YYYY-MM-DD hh:mm:ss"}' ng-model="startDate" class="input-sm form-control laydate-icon" width="200px;" style="display: inline-block;width: auto;" >
            </div>
            <div class=" mr-5">
              <span>结束时间:</span>
              <input type="text" laydate ng-model="endDate" class="input-sm form-control laydate-icon" width="200px;" style="display: inline-block;width: auto;">
            </div>
            <div class="input-group" style="width: 200px;">
              <input type="text" class="input-sm form-control" placeholder="Search" ng-model="search_context" >
              <span class="input-group-btn">
                <button class="btn btn-sm btn-default" ng-click="search()" type="button">Go!</button>
              </span>
            </div>
        </div>
    
          
      </div>
    </div>

    <!-- 数据展示 -->
    <div class="wrapper">
      <table class="table table-bordered table-condensed table-striped table-hover ">
        <thead>
          <tr>
            <th style="width:20px;">
              <label class="i-checks m-b-none">
                <input type="checkbox" ng-click="selectAll()"  ng-checked="selected"><i></i>
              </label>
            </th>
            <th>文章标题</th>
            <th>标签</th>
            <th>时间</th>
            <th class="w-15">操作</th>
          </tr>
        </thead>
        <tbody>
          <tr ng-repeat="item in dataList">
            <td><label class="i-checks m-b-none"><input type="checkbox" ng-model="item.selected"><i></i></label></td>
            <td><span ng-bind="item.articleTitle"></span></td>
            <td><span ng-bind="item.articleLabel"></span></td>
            <td><span ng-bind="item.articleShowtime"></span></td>
            <td class="text-center">
              <a href="javascript:;" class="c-primary" data-toggle="modal" data-target="#m1" ng-click="toEditView(item.articleId)">dialog编辑</a>
              <a href="javascript:;" class="c-primary" ui-sref="app.news.detail({id:item.articleId})">编辑</a>
              <a href="javascript:;" class="c-primary" ng-click="del(item.articleId)">删除</a>
            </td>
          </tr>
          
        </tbody>
      </table>
      <!-- 数据分页 -->
      <div class="table-pager clearfix">
        <ul class="pagination pull-left">
            <li>
                <a>共{{pagerOption.pages}}页,{{pagerOption.total}}条记录</a>
            </li>
        </ul>
        <!-- 分页插件 -->
        <uib-pagination total-items="pagerOption.total" ng-model="queryModel.page" max-size="10" ng-change="query()" items-per-page="pagerOption.pagesize" boundary-links="true" class="pagination-md pull-right" rotate="false" num-pages="pagerOption.pages"></uib-pagination>
      </div>
      
    </div>

  </div>



  <!-- edit modal -->
  <div class="modal fade" tabindex="-1" role="dialog" id="m1">
    <div class="modal-dialog" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
          <h4 class="modal-title">编辑</h4>
        </div>
        <div class="modal-body">
          <form class="form-horizontal" ng-submit="submit()" name="f1">
              <input type="hidden" class="form-control" ng-model="data.articleId" >
              <div class="form-wrapper wrapper">
                  <div class="ctrl-wrap flex aic mb-7">
                    <div class="w-6em form-label">
                      <label for="">文章标题:</label>
                    </div>
                    <div class="flex-1 form-field">
                      <input type="text" required="" class="form-control" ng-model="data.articleTitle" name="articleTitle">
                    </div>
                  </div>
                  <div class="ctrl-wrap flex aic  mb-7">
                    <div class="w-6em form-label">
                      <label for="">文章内容:</label>
                    </div>
                    <div class="flex-1 form-field">
                      <input type="text" required="" class="form-control" ng-model="data.articleContent" name="articleContent">
                    </div>
                  </div>
                  
                  <div class="form-action">
                    <div class="dib w-6em"></div><button class="btn btn-primary" type="submit" data-dismiss="modal">提交</button>
                  </div>
                </div>
              
           </form>
        </div>
        
      </div>
    </div>
  </div>



</div>


